package com.edu.entity.blog;

import com.baomidou.mybatisplus.annotation.TableField;
import com.edu.entity.user.EduUser;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author: LuckyBear
 * @date: 2018-10-30 8:57
 * @description:
 */

public class Article {
    private int id;     //主键(文章编号)
    private String articletitle;        //文章标题
    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    private Date articletime;        //发表时间
    private Integer publisherid;       //博主编号
    private String articlecontent;         //文章内容
    private int commentscount;     //评论数
    private int likecount;          //点赞数
    private int viewcount;         //浏览数
    private String titlephoto;         //标题图片
    private String brief;   //引导语

    @TableField(exist = false)
    private EduUser eduUser;

    public Article() {
    }

    public Article(String articletitle, Date articletime, Integer publisherid, String articlecontent, int commentscount, int likecount, int viewcount, String titlephoto, String brief, EduUser eduUser) {
        this.articletitle = articletitle;
        this.articletime = articletime;
        this.publisherid = publisherid;
        this.articlecontent = articlecontent;
        this.commentscount = commentscount;
        this.likecount = likecount;
        this.viewcount = viewcount;
        this.titlephoto = titlephoto;
        this.brief = brief;
        this.eduUser = eduUser;
    }

    public Article(int id, String articletitle, Date articletime, Integer publisherid, String articlecontent, int commentscount, int likecount, int viewcount, String titlephoto, String brief, EduUser eduUser) {
        this.id = id;
        this.articletitle = articletitle;
        this.articletime = articletime;
        this.publisherid = publisherid;
        this.articlecontent = articlecontent;
        this.commentscount = commentscount;
        this.likecount = likecount;
        this.viewcount = viewcount;
        this.titlephoto = titlephoto;
        this.brief = brief;
        this.eduUser = eduUser;
    }

    public Article(String articletitle, Date articletime, Integer publisherid, String articlecontent, String titlephoto, String brief) {
        this.articletitle = articletitle;
        this.articletime = articletime;
        this.publisherid = publisherid;
        this.articlecontent = articlecontent;
        this.titlephoto = titlephoto;
        this.brief = brief;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getArticletitle() {
        return articletitle;
    }

    public void setArticletitle(String articletitle) {
        this.articletitle = articletitle;
    }

    public Date getArticletime() {
        return articletime;
    }

    public void setArticletime(Date articletime) {
        this.articletime = articletime;
    }

    public Integer getPublisherid() {
        return publisherid;
    }

    public void setPublisherid(Integer publisherid) {
        this.publisherid = publisherid;
    }

    public String getArticlecontent() {
        return articlecontent;
    }

    public void setArticlecontent(String articlecontent) {
        this.articlecontent = articlecontent;
    }

    public int getCommentscount() {
        return commentscount;
    }

    public void setCommentscount(int commentscount) {
        this.commentscount = commentscount;
    }

    public int getLikecount() {
        return likecount;
    }

    public void setLikecount(int likecount) {
        this.likecount = likecount;
    }

    public int getViewcount() {
        return viewcount;
    }

    public void setViewcount(int viewcount) {
        this.viewcount = viewcount;
    }

    public String getTitlephoto() {
        return titlephoto;
    }

    public void setTitlephoto(String titlephoto) {
        this.titlephoto = titlephoto;
    }

    public String getBrief() {
        return brief;
    }

    public void setBrief(String brief) {
        this.brief = brief;
    }

    public EduUser getEduUser() {
        return eduUser;
    }

    public void setEduUser(EduUser eduUser) {
        this.eduUser = eduUser;
    }

    @Override
    public String toString() {
        return "Article{" +
                "id=" + id +
                ", articletitle='" + articletitle + '\'' +
                ", articletime=" + articletime +
                ", publisherid=" + publisherid +
                ", articlecontent='" + articlecontent + '\'' +
                ", commentscount=" + commentscount +
                ", likecount=" + likecount +
                ", viewcount=" + viewcount +
                ", titlephoto='" + titlephoto + '\'' +
                ", brief='" + brief + '\'' +
                ", eduUser=" + eduUser +
                '}';
    }
}
